<template>
	<view class="register form">
		<view class="ipt-group">
			<image class="icon" src="../../static/images/ac2.png" mode="aspectFit"></image>
			<input class="ipt" type="password" value="" placeholder="请输入账号" placeholder-class="ipt-pc" v-model="form.account">
		</view>
		
		<view class="ipt-group">
			<textarea class="zjc" value="" placeholder="请输入助记词,助记词之间以空格分隔" placeholder-class="ipt-pc" v-model="form.mnemonic" />
		</view>
		
		<view class="ipt-group">
			<image class="icon" src="../../static/images/ac2.png" mode="aspectFit"></image>
			<input class="ipt" type="password" value="" placeholder="请输入新密码" placeholder-class="ipt-pc" v-model="form.password">
		</view>
		
		<view class="btn-wrap">
			<button class="cu-btn block radius register" @click="cgpwd">
				找回密码
			</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					account: '',
					mnemonic: '',
					password: '',
				}
			};
		},
		methods: {
			cgpwd() {
				this.$u.post('/passport/password/forget', this.form).then(res => {
					console.log(res)
					if (res.data.code == 0) {
						uni.showToast({
							title: '修改成功',
							icon: 'none'
						})
						setTimeout(() => {
							uni.reLaunch({
								url: '/pages/mine/mine'
							})
						}, 1000)
					} else {
						uni.showToast({
							title: res.data.msg,
							icon: 'none'
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.zjc {
		width: 570rpx;
		margin: 0 auto;
		padding: 10rpx 20rpx;
		color: #fff;
		background-color: rgba(37, 59, 102, 0.3);
	}
</style>
